<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>泸职旅游网-我的收藏</title>
        <link href="css/bootstrap.min.css" rel="stylesheet">
        <link rel="stylesheet" type="text/css" href="css/common.css">
        <link rel="stylesheet" href="css/index.css">
       <style>
           .tab-content .row>div {
            margin-top: 16px;
           } 
           .tab-content {
            margin-bottom: 36px;
           }
       </style>
       <script src="js/jquery-3.3.1.js"></script>
        <script>
            $(function () {
              load()
            })
            function load(currentPage) {
                    $.post("route/MyFavorite",{"currentPage":currentPage},function (data) {
                            var lis="";
                        var firstPage='<li onclick="load('+1+')"><a href="javascript:void(0);">首页</a></li>';
                        var befNum=data.currentPage-1;
                        if (befNum<=0){
                            befNum=1
                        }
                        var befPage='<li  onclick="load('+befNum+')" class="threeword"><a href="javascript:void(0)">上一页</a></li>';
                        lis+=firstPage;
                        lis+=befPage;
                        var begin;
                        var end;
                        if (data.totalPage<10){
                            begin=1;
                            end=data.totalPage;
                        }else {
                            begin=data.currentPage-5;
                            end=data.currentPage+4;
                            if (begin<1){
                                begin=1;
                                end=begin+9;
                            }
                            if (end>data.totalPage){
                                end=data.totalPage;
                                begin=end-1;
                            }
                        }
                        for (var i = begin; i <=end; i++) {
                            var li;
                            if (data.currentPage==i){
                                li='<li class="curPage" onclick="load('+i+')"><a href="javascript:void(0)">'+i+'</a></li>'
                            }else {
                                li='<li onclick="load('+i+')"><a href="javascript:void(0)">'+i+'</a></li>'
                            }

                            lis+=li;
                        }
                        var lastPage='<li class="threeword" onclick="load('+data.totalPage+')"><a href="javascript:void(0)">末页</a></li>';
                        var preNum=data.currentPage+1;
                        var prePage='<li class="threeword" onclick="load('+preNum+')"><a href="javascript:void(0)">下一页</a></li>';
                        lis+=prePage;
                        lis+=lastPage
                        $("#pageNum").html(lis);
                        var kuaiF = $("#kuai_f");
                        var route_lis="";
                        for (var i = 0; i <data.list.length; i++) {
                            var routee=data.list[i];
                            var li='<div class="col-md-3">\n' +
'                                    <a href="route_detail.html?rid='+routee.rid+'">\n' +
'                                        <img src="'+routee.rimage+'" alt="">\n' +
'                                        <div class="has_border">\n' +
'                                            <h3>'+routee.rname+'</h3>\n' +
'                                            <div class="price">网付价<em>￥</em><strong>'+routee.price+'</strong><em>起</em></div>\n' +
'                                        </div>\n' +
'                                    </a>\n' +
'                                </div>';
                            route_lis+=li;
                        }
                        kuaiF.html(route_lis)
                        window.scrollTo(0,0)
                    })
            }
        </script>
    </head>
    <body>
    <!--引入头部-->
    <div id="header"></div>
         <!-- 排行榜 start-->
        <section id="content">            
            <section class="hemai_jx">
                <div class="jx_top">
                    <div class="jx_tit">
                        <img src="images/icon_5.jpg" alt="">
                        <span>我的收藏</span>
                    </div>                    
                </div>
                <div class="jx_content">
                    <!-- Tab panes -->
                    <div class="tab-content">
                        <div role="tabpanel" class="tab-pane active" id="home">
                            <div class="row" id="kuai_f">
                            </div>
                        </div>                       
                    </div>
                </div>
                <div class="pageNum">
                    <ul id="pageNum">
                    </ul>
                </div>
            </section>                      
        </section>
        <!-- 排行榜 end-->
    	
         <!--引入尾部-->
    	<div id="footer"></div>
        <!--导入布局js，共享header和footer-->
        <script type="text/javascript" src="js/include.js"></script>
    </body>
</html>